package com.ylsd.dynamic.util;


import com.qiniu.util.Auth;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class QiniuUtil {
    @Value("${qiniu.accessKey}")
    String accessKey = "access key";
    @Value("${qiniu.secretKey}")
    String secretKey = "secret key";
    @Value("${qiniu.bucket}")
    String bucket = "bucket name";

    public String getUploadToken(){
        Auth auth = Auth.create(accessKey, secretKey);
        String upToken = auth.uploadToken(bucket);
        return upToken;
    }
}
